//package forum.service.shiro_test;
//
///**
// * Created by Administrator on 2017/4/19.
// */
//import java.text.SimpleDateFormat;
//import java.util.Date;
//
//import forum.repository.TokenRepository;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//@Component
//public class ScheduledTasks {
//    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
//
//    @Autowired
//    private TokenRepository tokenRepository;
//
//    private final Logger logger = LoggerFactory.getLogger(this.getClass());
//    @Scheduled(fixedRate = 1800000)
//    public void reportCurrentTime() {
//        logger.info("The time is now " + dateFormat.format(new Date()));
//        tokenRepository.deleteAll();
//    }
//}